/*
 * Selling Partner API for Orders
 *
 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
 *
 * The version of the OpenAPI document: v0
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = software.amzn.spapi.Client.OpenAPIDateConverter;

namespace software.amzn.spapi.Model.orders.v0
{
    /// <summary>
    /// The request schema for an shipment confirmation.
    /// </summary>
    [DataContract(Name = "ConfirmShipmentRequest")]
    public partial class ConfirmShipmentRequest : IValidatableObject
    {
        /// <summary>
        /// The COD collection method (only supported in the JP marketplace).
        /// </summary>
        /// <value>The COD collection method (only supported in the JP marketplace).</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum CodCollectionMethodEnum
        {
            /// <summary>
            /// Enum DirectPayment for value: DirectPayment
            /// </summary>
            [EnumMember(Value = "DirectPayment")]
            DirectPayment = 1
        }


        /// <summary>
        /// The COD collection method (only supported in the JP marketplace).
        /// </summary>
        /// <value>The COD collection method (only supported in the JP marketplace).</value>
        [DataMember(Name = "codCollectionMethod", EmitDefaultValue = false)]
        public CodCollectionMethodEnum? CodCollectionMethod { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="ConfirmShipmentRequest" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ConfirmShipmentRequest() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ConfirmShipmentRequest" /> class.
        /// </summary>
        /// <param name="packageDetail">packageDetail (required).</param>
        /// <param name="codCollectionMethod">The COD collection method (only supported in the JP marketplace)..</param>
        /// <param name="marketplaceId">The unobfuscated marketplace identifier. (required).</param>
        public ConfirmShipmentRequest(PackageDetail packageDetail = default(PackageDetail), CodCollectionMethodEnum? codCollectionMethod = default(CodCollectionMethodEnum?), string marketplaceId = default(string))
        {
            // to ensure "packageDetail" is required (not null)
            if (packageDetail == null)
            {
                throw new ArgumentNullException("packageDetail is a required property for ConfirmShipmentRequest and cannot be null");
            }
            this.PackageDetail = packageDetail;
            // to ensure "marketplaceId" is required (not null)
            if (marketplaceId == null)
            {
                throw new ArgumentNullException("marketplaceId is a required property for ConfirmShipmentRequest and cannot be null");
            }
            this.MarketplaceId = marketplaceId;
            this.CodCollectionMethod = codCollectionMethod;
        }

        /// <summary>
        /// Gets or Sets PackageDetail
        /// </summary>
        [DataMember(Name = "packageDetail", IsRequired = true, EmitDefaultValue = true)]
        public PackageDetail PackageDetail { get; set; }

        /// <summary>
        /// The unobfuscated marketplace identifier.
        /// </summary>
        /// <value>The unobfuscated marketplace identifier.</value>
        [DataMember(Name = "marketplaceId", IsRequired = true, EmitDefaultValue = true)]
        public string MarketplaceId { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class ConfirmShipmentRequest {\n");
            sb.Append("  PackageDetail: ").Append(PackageDetail).Append("\n");
            sb.Append("  CodCollectionMethod: ").Append(CodCollectionMethod).Append("\n");
            sb.Append("  MarketplaceId: ").Append(MarketplaceId).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
